package baseTest;

public class MaxArea {
    public static void main(String[] args) {

    }

    public static int process(int[] height){
        if (height == null || height.length <1){
            return 0;
        }
        int l = 0;
        int r = height.length-1;
        int length = height.length -1;
        long maxArea = Math.min(height[l],height[r]) * length;
        while (l<r && length>0){
            if (height[l] > height[r]){
                l++;
                length--;
            } else if (l<r){
                r--;
                length--;
            }
            long cur = Math.min(height[l],height[r])*length;
            maxArea = Math.max(maxArea,cur);
        }
        return 0;
    }
}
